package com.battcn.util;

import org.springframework.context.ApplicationContext;

public class ApplicationContextUtil implements java.io.Serializable{

    private static final long serialVersionUID = -8808350232648362983L;

    private static ApplicationContext applicationContext;

    public static void setApplicationContext(ApplicationContext context) {
        applicationContext = context;
    }

    public static Object getBean(String beanName) {
        return applicationContext.getBean(beanName);
    }

    public static Object getBean(@SuppressWarnings("rawtypes") Class clazz) {
        return applicationContext.getBean(clazz);
    }

}
